package com.ctsi.ssdc.admin.repository;

import java.util.List;

import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.DeleteProvider;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.InsertProvider;
import org.apache.ibatis.annotations.Options;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Result;
import org.apache.ibatis.annotations.Results;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.SelectProvider;
import org.apache.ibatis.annotations.Update;
import org.apache.ibatis.annotations.UpdateProvider;
import org.apache.ibatis.type.JdbcType;

import com.ctsi.ssdc.admin.domain.CscpLogLogin;
import com.ctsi.ssdc.admin.domain.CscpLogLoginExample;
import com.ctsi.ssdc.database.annotation.InjectByDataBaseType;
import com.ctsi.ssdc.database.enums.EnumDatabaseName;

/**
 * @author MyBatis Generator
*/
@InjectByDataBaseType(includes= {EnumDatabaseName.ORACLE})
public interface CscpLogLoginRepository {
    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table cscp_log_login
     *
     * @mbg.generated Fri Aug 03 08:51:06 CST 2018
     */
    @SelectProvider(type=CscpLogLoginSqlProvider.class, method="countByExample")
    long countByExample(CscpLogLoginExample example);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table cscp_log_login
     *
     * @mbg.generated Fri Aug 03 08:51:06 CST 2018
     */
    @DeleteProvider(type=CscpLogLoginSqlProvider.class, method="deleteByExample")
    int deleteByExample(CscpLogLoginExample example);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table cscp_log_login
     *
     * @mbg.generated Fri Aug 03 08:51:06 CST 2018
     */
    @Delete({
        "delete from cscp_log_login",
        "where id = #{id,jdbcType=INTEGER}"
    })
    int deleteByPrimaryKey(Integer id);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table cscp_log_login
     *
     * @mbg.generated Fri Aug 03 08:51:06 CST 2018
     */
    @Insert({
        "insert into cscp_log_login (user_name, ip, ",
        "message, time, ",
        "status)",
        "values (#{userName,jdbcType=VARCHAR}, #{ip,jdbcType=VARCHAR}, ",
        "#{message,jdbcType=VARCHAR}, #{time,jdbcType=TIMESTAMP}, ",
        "#{status,jdbcType=VARCHAR})"
    })
    @Options(useGeneratedKeys=true, keyProperty="id")
    int insert(CscpLogLogin record);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table cscp_log_login
     *
     * @mbg.generated Fri Aug 03 08:51:06 CST 2018
     */
    @InsertProvider(type=CscpLogLoginSqlProvider.class, method="insertSelective")
    @Options(useGeneratedKeys=true, keyProperty="id")
    int insertSelective(CscpLogLogin record);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table cscp_log_login
     *
     * @mbg.generated Fri Aug 03 08:51:06 CST 2018
     */
    @SelectProvider(type=CscpLogLoginSqlProvider.class, method="selectByExample")
    @Results({
        @Result(column="id", property="id", jdbcType=JdbcType.INTEGER, id=true),
        @Result(column="user_name", property="userName", jdbcType=JdbcType.VARCHAR),
        @Result(column="ip", property="ip", jdbcType=JdbcType.VARCHAR),
        @Result(column="message", property="message", jdbcType=JdbcType.VARCHAR),
        @Result(column="time", property="time", jdbcType=JdbcType.TIMESTAMP),
        @Result(column="status", property="status", jdbcType=JdbcType.VARCHAR)
    })
    List<CscpLogLogin> selectByExample(CscpLogLoginExample example);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table cscp_log_login
     *
     * @mbg.generated Fri Aug 03 08:51:06 CST 2018
     */
    @Select({
        "select",
        "id, user_name, ip, message, time, status",
        "from cscp_log_login",
        "where id = #{id,jdbcType=INTEGER}"
    })
    @Results({
        @Result(column="id", property="id", jdbcType=JdbcType.INTEGER, id=true),
        @Result(column="user_name", property="userName", jdbcType=JdbcType.VARCHAR),
        @Result(column="ip", property="ip", jdbcType=JdbcType.VARCHAR),
        @Result(column="message", property="message", jdbcType=JdbcType.VARCHAR),
        @Result(column="time", property="time", jdbcType=JdbcType.TIMESTAMP),
        @Result(column="status", property="status", jdbcType=JdbcType.VARCHAR)
    })
    CscpLogLogin selectByPrimaryKey(Integer id);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table cscp_log_login
     *
     * @mbg.generated Fri Aug 03 08:51:06 CST 2018
     */
    @UpdateProvider(type=CscpLogLoginSqlProvider.class, method="updateByExampleSelective")
    int updateByExampleSelective(@Param("record") CscpLogLogin record, @Param("example") CscpLogLoginExample example);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table cscp_log_login
     *
     * @mbg.generated Fri Aug 03 08:51:06 CST 2018
     */
    @UpdateProvider(type=CscpLogLoginSqlProvider.class, method="updateByExample")
    int updateByExample(@Param("record") CscpLogLogin record, @Param("example") CscpLogLoginExample example);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table cscp_log_login
     *
     * @mbg.generated Fri Aug 03 08:51:06 CST 2018
     */
    @UpdateProvider(type=CscpLogLoginSqlProvider.class, method="updateByPrimaryKeySelective")
    int updateByPrimaryKeySelective(CscpLogLogin record);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table cscp_log_login
     *
     * @mbg.generated Fri Aug 03 08:51:06 CST 2018
     */
    @Update({
        "update cscp_log_login",
        "set user_name = #{userName,jdbcType=VARCHAR},",
          "ip = #{ip,jdbcType=VARCHAR},",
          "message = #{message,jdbcType=VARCHAR},",
          "time = #{time,jdbcType=TIMESTAMP},",
          "status = #{status,jdbcType=VARCHAR}",
        "where id = #{id,jdbcType=INTEGER}"
    })
    int updateByPrimaryKey(CscpLogLogin record);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table cscp_log_login
     *
     * @mbg.generated Fri Aug 03 08:51:06 CST 2018
     */
    @SelectProvider(type=CscpLogLoginSqlProvider.class, method="selectByExampleWithPage")
    @Results({
        @Result(column="id", property="id", jdbcType=JdbcType.INTEGER, id=true),
        @Result(column="user_name", property="userName", jdbcType=JdbcType.VARCHAR),
        @Result(column="ip", property="ip", jdbcType=JdbcType.VARCHAR),
        @Result(column="message", property="message", jdbcType=JdbcType.VARCHAR),
        @Result(column="time", property="time", jdbcType=JdbcType.TIMESTAMP),
        @Result(column="status", property="status", jdbcType=JdbcType.VARCHAR)
    })
    List<CscpLogLogin> selectByExamplewithPage(CscpLogLoginExample example);
}